package com.xxkj.drugtraceability.base

import com.xxkj.drugtraceability.net.WanRetrofitClient
import com.xxkj.drugtraceability.net.WanService
import com.xxkj.drugtraceability.ui.departdrug.DepartDrugCollectionRepository
import com.xxkj.drugtraceability.ui.departdrug.DepartDrugCollectionViewModel
import com.xxkj.drugtraceability.ui.departhd.DepartDrugHdCollectionRepository
import com.xxkj.drugtraceability.ui.departhd.DepartDrugHdCollectionViewModel
import com.xxkj.drugtraceability.ui.doctoradviceback.DoctorAdviceBackRepository
import com.xxkj.drugtraceability.ui.doctoradviceback.DoctorAdviceBackViewModel
import com.xxkj.drugtraceability.ui.doctoradvicecollection.DoctorAdviceCollectionRepository
import com.xxkj.drugtraceability.ui.doctoradvicecollection.DoctorAdviceCollectionViewModel
import com.xxkj.drugtraceability.ui.drugout.DrugOutRepository
import com.xxkj.drugtraceability.ui.drugout.DrugOutViewModel
import com.xxkj.drugtraceability.ui.drugoutscan.DrugOutScanRepository
import com.xxkj.drugtraceability.ui.drugoutscan.DrugOutScanViewModel
import com.xxkj.drugtraceability.ui.drugscan.DrugScanRepository
import com.xxkj.drugtraceability.ui.drugscan.DrugScanViewModel
import com.xxkj.drugtraceability.ui.drugstorage.DrugStorageRepository
import com.xxkj.drugtraceability.ui.drugstorage.DrugStorageViewModel
import com.xxkj.drugtraceability.ui.hascollected.HasCollectedRepository
import com.xxkj.drugtraceability.ui.hascollected.HasCollectedViewModel
import com.xxkj.drugtraceability.ui.login.LoginRepository
import com.xxkj.drugtraceability.ui.login.LoginViewModel
import com.xxkj.drugtraceability.ui.main.MainRepository
import com.xxkj.drugtraceability.ui.main.MainViewModel
import com.xxkj.drugtraceability.ui.patientlist.PatientListRepository
import com.xxkj.drugtraceability.ui.patientlist.PatientListViewModel
import com.xxkj.drugtraceability.ui.prescriptiondrugback.PrescriptionDrugBackRepository
import com.xxkj.drugtraceability.ui.prescriptiondrugback.PrescriptionDrugBackViewModel
import com.xxkj.drugtraceability.ui.prescriptiondrugcollection.PrescriptionDrugCollectionRepository
import com.xxkj.drugtraceability.ui.prescriptiondrugcollection.PrescriptionDrugCollectionViewModel
import com.xxkj.drugtraceability.ui.start.StartRepository
import com.xxkj.drugtraceability.ui.start.StartViewModel
import com.xxkj.drugtraceability.ui.tracdetail.TracDetailViewModel
import com.xxkj.drugtraceability.ui.tracdetail.TracRepository
import com.xxkj.drugtraceability.ui.update.UpdateViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module


val viewModelModule = module {
    viewModel { LoginViewModel(get(), get()) }
    viewModel { MainViewModel(get(), get()) }
    viewModel { DrugStorageViewModel(get(), get()) }
    viewModel { DrugScanViewModel(get(), get()) }
    viewModel { PrescriptionDrugCollectionViewModel(get(), get()) }
    viewModel { PrescriptionDrugBackViewModel(get(), get()) }
    viewModel { PatientListViewModel(get(), get()) }
    viewModel { DoctorAdviceCollectionViewModel(get(), get()) }
    viewModel { DoctorAdviceBackViewModel(get(), get()) }
    viewModel { DrugOutViewModel(get(), get()) }
    viewModel { DrugOutScanViewModel(get(), get()) }
    viewModel { HasCollectedViewModel(get(), get()) }
    viewModel { TracDetailViewModel(get(), get()) }
    viewModel { StartViewModel(get(), get()) }
    viewModel { UpdateViewModel(get()) }
    viewModel { DepartDrugCollectionViewModel(get(), get()) }
    viewModel { DepartDrugHdCollectionViewModel(get(), get()) }
}
val repositoryModule = module {
    single { WanRetrofitClient.getService(WanService::class.java, WanService.BASE_URL) }
    single { LoginRepository(get()) }
    single { MainRepository(get()) }
    single { DrugStorageRepository(get()) }
    single { DrugScanRepository(get()) }
    single { PrescriptionDrugCollectionRepository(get()) }
    single { PrescriptionDrugBackRepository(get()) }
    single { PatientListRepository(get()) }
    single { DoctorAdviceCollectionRepository(get()) }
    single { DoctorAdviceBackRepository(get()) }
    single { DrugOutRepository(get()) }
    single { DrugOutScanRepository(get()) }
    single { HasCollectedRepository(get()) }
    single { TracRepository(get()) }
    single { StartRepository(get()) }
    single { DepartDrugCollectionRepository(get()) }
    single { DepartDrugHdCollectionRepository(get()) }

}

val appModule = listOf(viewModelModule, repositoryModule)